package com.wtf.dsp.admin.core.config;


import com.wtf.dsp.admin.core.dao.AbstractJdbcDao;
import com.wtf.dsp.admin.core.dao.DbJdbcGeneratorDao;
import com.wtf.dsp.admin.core.support.DbSqlMapperRepositorySupport;
import com.wtf.dsp.admin.core.table.DbTableSql;
import com.wtf.dsp.admin.mapper.WtfDspDbConfigMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;

/**
 * description: 数据源数据库配置类
 * date: 2022/6/18 10:59
 * @author linhuanyou
 * @email 496558736@qq.com
 * @version 1.0
 */
@Configuration
public class DsDbConfig {

    @Bean
    public DbTableSql dbTableSqlSupport(){
        return new DbSqlMapperRepositorySupport();
    }

    @Autowired
    private WtfDspDbConfigMapper wtfDspDbConfigMapper;

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Bean
    public AbstractJdbcDao abstractGeneratorDao(){
        return new DbJdbcGeneratorDao(jdbcTemplate,wtfDspDbConfigMapper);
    }


}
